<?php
require_once('lib/nusoap.php');

$str_user = $_POST['str_usuario'];
$str_pwd = $_POST['str_password'];
$str_DGenerales = $_POST['str_datGenerales'];
$str_DRegistro = $_POST['str_datRegistro'];
$str_DLaboratorio = $_POST['str_datLaboratorio'];
$str_ADiagnosticos = $_POST['str_auxDiagnosticos'];
$str_AHistorial = $_POST['str_auxHistorial'];
$str_ALaboratorio = $_POST['str_auxLaboratorio'];
$str_AMuestras = $_POST['str_auxMuestras'];
$str_ASintomas = $_POST['str_auxSintomas'];
$str_AViajes = $_POST['str_auxViajes'];

$client = new nusoap_client('http://influenza.rhove.gob.mx/influenza/ws_imss/servicio.php');

$client->setCredentials($user, $pass, 'basic');

$err = $client->getError();
if ($err) 
    {   echo '<p><b>Constructor error: ' . $err . '</b></p>';   }
else
    {   $autenticacion = array('str_user' => $str_user,'str_password' => $str_pwd);
        $datos = array('dat_generales' => $str_DGenerales,
              'dat_registro' => $str_DRegistro,
              'dat_laboratorio' => $str_DLaboratorio,
              'aux_muestras' => $str_AMuestras,
              'aux_laboratorio' => $str_ALaboratorio,
              'aux_sintomas' => $str_ASintomas,
              'aux_historialevolucion' => $str_AHistorial,
              'aux_diagnostico' => $str_ADiagnosticos,
              'aux_viajes' => $str_AViajes
          );

        $result = $client->call('registro', array ('datos' => $datos, 'autenticacion' => $autenticacion));
        if ($client->fault) 
            {   echo '<p><b>Fault: ';
                print_r($result);
                echo '</b></p>';
            }
        else {
                $err = $client->getError();
                if ($err)
                    {   echo '<p><b>Error: ' . $err . '</b></p>';   }
                else
                    {   print_r($result);   }
            }

    }
/*
1.dat_generales
2.dat_registro
3.dat_laboratorio
4.aux_muestras
5.aux_laboratorio
6.aux_sintomas
7.aux_historialevolucion
8.aux_diagnostico
9.aux_viajes
 */
?>